package mobi.greenplate.theweb.converter;

import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;
import java.util.Date;

import mobi.greenplate.theweb.domain.RequestRide;
//for : enum types (and many-to-one)

import mobi.greenplate.theweb.domain.RideState;    


@XmlRootElement(name = "requestRide")
public class RequestRideConverter {
    private final RequestRide entity;

    public RequestRideConverter() {
        this.entity = new RequestRide();
    }

    public RequestRideConverter(RequestRide entity) {
        this.entity = entity;
    }
    
    @XmlTransient
    public RequestRide getEntity(){
        return entity;
    }

    @XmlElement
    public Long getId() {
        return entity.getId();
    }

    public void setId(Long id) {
        entity.setId(id);
    }
    
    @XmlElement
    public RideState getRideState() {
        return entity.getRideState();
    }
    
    public void setRideState(RideState rideState) {
        entity.setRideState(rideState);
    }
    @XmlElement
    public Date getStartTime() {
        return entity.getStartTime();
    }
    
    public void setStartTime(Date startTime) {
        entity.setStartTime(startTime);
    }
    
    @XmlElement
    public AddressConverter getStartAddress() {
        return new AddressConverter(entity.getStartAddress());
    }
    
    public void setStartAddress(AddressConverter addressConverter) {
         entity.setStartAddress(addressConverter.getEntity());
    }

    @XmlElement
    public AddressConverter getEndAddress() {
        return new AddressConverter(entity.getEndAddress());
    }
    
    public void setEndAddress(AddressConverter addressConverter) {
         entity.setEndAddress(addressConverter.getEntity());
    }

    @XmlElement
    public UserConverter getRequester() {
        return new UserConverter(entity.getRequester());
    }

    public void setRequester(UserConverter userConverter) {
        entity.setRequester(userConverter.getEntity());
    }


   
}

